
/**
 * 得到当天时间起始数组
 * 从当天零点开始，到当前
 * */
export function initRangeDate(){

  //根据bootstrap日期输出格式拼接
  //开始时间
  let startDate = new Date();
  //结束时间
  let endDate = new Date();
  endDate.setDate(endDate.getDate()+1);

  let cusDateRange = []
  cusDateRange[0] = getDateStr(startDate)
  cusDateRange[1] = getDateStr(endDate)

  return cusDateRange;
}

function getDateStr(date){
  let y = date.getFullYear();//年
  let m = date.getMonth() + 1;//月
  m = m < 10 ? '0' + m : m;
  let d = date.getDate();//天
  d = d < 10 ? ('0' + d) : d;
  return y + '-' + m + '-' + d +' 00:00:00';
  // let h = date.getHours();//时
  // h = h < 10 ?('0' + h) : h;
  // let min = date.getMinutes();//分
  // min = min < 10 ?('0' + min) : min;
  // let seconds = date.getSeconds()
  // seconds = seconds < 10 ?('0' + seconds) : seconds;
}
